import React, { useState, useEffect, useRef } from 'react';
import SpecialTable from './components/SpecialTable';
import NormTable from './components/NormTable';
import { connect } from 'dva';
import { Table, DatePicker, Select, Button, Modal, message, Radio, Input } from 'antd';

import { getHeavyLuggagePlaceSelectList } from './service';
function Index({ dispatch }) {
  const [optionRadio, setoptionRadio] = useState('norm');

  useEffect(() => {
    getHeavyLuggagePlaceSelectList();
  }, []);
  const getHeavyLuggagePlaceSelectList = () => {
    dispatch({
      type: 'heavyLuggage/getHeavyLuggagePlaceSelectList',
      payload: {},
      callback: data => {
        console.log(data);
      },
    });
  };
  return (
    <div>
      <div
        style={{
          display: 'flex',
          flexDirection: 'row-reverse',
          background: '#fff',
        }}
      >
        <Radio.Group
          buttonStyle="solid"
          value={optionRadio}
          onChange={val => {
            setoptionRadio(val.target.value);
          }}
        >
          <Radio.Button value="special">特殊配置</Radio.Button>
          <Radio.Button value="norm">标准配置</Radio.Button>
        </Radio.Group>
      </div>
      {optionRadio === 'special' ? <SpecialTable></SpecialTable> : <NormTable></NormTable>}
    </div>
  );
}
export default connect()(Index);
